Okay, so last lesson we started off looking at constraints.
We're going to continue on with that with this lesson.
We looked at first four and explained quite a lot of the properties.
Today we're going to push through and do the rest of ones focusing a little bit less on the properties,
because the majority of this of them are the same once you know them.
Okay.
So we're going to be focusing on the rope rod and spring constraints today along with a couple other
ones as well.
So let's add in two parts.
Again, the rope rod and spring work in the same kind of way is that they're going to be suspended from
the ceiling.
So be one here.
There'll be one down here for example.
Expand this one out a bit so it looks like it's part of a ceiling I guess.
And yeah.
Cool.
So this one's going to have the attachment zero in it.
So the one that doesn't move.
And this one here is going to have the second attachments.
Attachment one that does move.
Let's add in a rope rod constraint to start off with though a bit simpler than the ropes.
And we're going to create attachments zero there and attachment one there.
Cool.
And we can immediately immediately see a connection between the two.
Okay.
So rods are very similar to ropes that was almost going to put in there.
The difference is they're a bit more restricted when it comes to movement.
Rods can rotate finely enough but they don't.
They don't go up and down.
If you push push it upwards it's not going to move anywhere.
But with a rope it would do.
So there's a bit more physics and a bit more settings involved with that one.
Visible you can toggle whether you want this visible or not, which always looks quite cool.
So this could be used.
Some of these could be used as visual effects as well.
It's a very important point I want to get across today.
Um light suspended.
Suspended, suspended from the ceiling, for example, or things like that.
You can use rod and rope constraints and spring constraints a little bit as well.
A lot in this case.
So don't think of them just as physics.
They are also sometimes have visual uses as well.
So in here we have the length of the rods limits enabled.
Again same kind of stuff.
The angles it can rotate by.
Okay.
Let's make sure this is unanchored in this case which I've made that mistake many times.
Last lecture and let's play the game and just see how this word constraints work okay.
So you can see it moving across just like that.
And we can push it and or push it properly.
It will move.
Yeah.
That's what happens when you don't put limits on, um, so pretty good.
Pretty good idea to, to do put those limits on.
So we're going to do that now.
Um limits enabled on and this 90 degrees are both fine with that.
Okay.
And if we try this out one more time, we can see we can push it just like that.
And it goes across like that.
Okay.
Um, another use I just thought of now as well is back when we made our, um, the obby.
If you did follow along with that section, this can be really good for some suspended parts that you
have to go on to and try and jump on to the next one.
So obviously didn't know about attachments and constraints at that point, but it could be something
you might want to go back and add in.
Um.
One issue think of this is I put the attachment one at the middle of the part, which is probably the
reason why it's flipping a lot.
So if I move it upwards, um, like that there, and also do the same for this other one, it will just
make it look, it will just make it function a little bit better.
So let's try that out one more time.
Oh, there we go.
It's not.
Hopefully not going to do that as much.
Yes.
So very similar to the rope constraint.
We can have a look in a minute.
Just can't be pushed up and down.
It stays.
The distance between that point and that point stays the exact same no matter what happens.
Okay.
Um cool.
So let's delete that and let's add in the rope constraint.
Now not much explaining needed doing with this one.
It's a rope okay.
Everyone knows how rope works.
Um, so let's play the game and just try out this one.
Okay.
So you can push it along.
You can see.
Right.
Let's put on some limits.
Enabled on.
Um, so this one doesn't actually have any limits.
Let's probably make it visible on so we can see the rope constraint working there.
Um, there's no limits to such we can turn on.
So let's just try that out again.
Um, so we can see it working like that.
And when I push it slightly, you can see it moving just like that.
I think when I completely barged my character into it, it's too much force pushed at once.
Um, but yeah, you see it just suspended via that.
Um, so yeah, ropes again are the most common one to be used.
Um, in terms of visually, a lot of people use it for lights.
So to suspend lights or like a lampshade, a bulb from the ceiling, that could really use of those
also power lines as well.
They're used to that one as well.
So lots of uses for these as you can very easily make some nice curves and things like that using rope
and rod, not rod constraints.
You can't curved rod constraints, but um, rope and rod constraints are very good with those ones.
Um, this one works a bit different.
There's a set length of the rope which can stretch and bend and so on, but that's the maximum distance
between the two attachments.
I'll put five as the default.
But again you can change that if you'd like.
And the winch enabled is quite a cool feature as well.
Basically if the winch enabled is on.
Be able to see it goes up like that there.
Um, and if I push it a bit more, I might do a bit more, but it went up slightly because the winch
is basically pulling the, um, it's pulling it upwards.
So a winch could be a really good feature also for a, um, a lift or an elevator as well.
But again, when you get into things like that, there are the physics is a bit more complicated with
those, um, trust me to make a nice realistic lift.
Um, not using scripting, but using constraints is a lot more than just a rope constraint.
Okay, um, just like how other things I've taught them individually, whereas really in proper uses,
like with a lift, for example, you're going to want to be going to want to be using multiple together
at once.
Okay.
Um, but yeah.
Okay.
So that's the rope constraint there.
The other one that's very similar is called the spring constraints.
Okay.
So these ones here let's connect the attachments together.
Attachment zero.
Attachment one.
You can see the spring are curving there okay.
So this one again is pretty good.
It has limits enabled.
So I'm going to turn that on and just go ahead and try that out.
You can see it here just like that.
And you can push it up and down and so on and all that kind of stuff like that's fair.
Just like how you how you expect it to function really.
You can change the number of coils, the radius and thickness of those coils, um, and some of the
effects here as well.
So the stiffness, the maximum length, minimum length, all kind of self-explanatory.
All be kind of seen before.
But for in some of the other constraints okay.
One use I thought of with the spring constraints is perhaps for an object where players can go onto
it and it slowly maybe presses down.
So like maybe a big button, for example, the player can press down on or other uses like that.
Okay.
So um, I guess constraints, like with quite a few of the things I've taught in this kind of advanced
section, they're not things you're going to be using every day.
However, when they do become useful, they can make your game, um, a lot more advanced and a lot
more lifelike, really.
Um, so they are pretty cool for that.
Okay.
Go back to the constraints section, and we've gone through a fair amount of these again, have skipped
out some because I've been a really relevant or so on.
Um, the one more I wanted to touch on actually was the world constraints.
Now, we have looked at this already.
So if we go over to this here, turn this off.
Um, so I've yeah, probably worth showing as well that you can do constraints using a tool here.
So I could do one here connecting to there for example.
You can do it that way.
I prefer not to because when it adds the attachments in, they're never centered.
They're always off a little bit.
So it's you can use it that way if you wanted to.
I personally just don't myself.
You can also change whether to show the welds or not and to show, um, constraint details on and off
like that there as well.
So you can hover over it and see the details of the constraint or the attachment.
So there are options if you want to do those as well.
I typically have this one on and this one off.
But again it is completely up to you.
So this world constraint we did touch on when we did tools.
I just want to talk about how that works in a bit more detail.
Now you probably know about constraints.
So the world constraints keeps the same amount of distance between one part and the other part.
Now this is one of the only constraints that doesn't work based on attachments, but it is works based
on the center of the part.
So there basically attachments.
But you haven't moved from there in the center.
So it makes sure that the center of this part is the same distance away from center of this part, no
matter what happens.
Okay.
So just wanted to touch on that one before we finish off there as well okay.
So hopefully that's explained quite a few of the constraints to you.
Okay.
There are a couple more.
Feel free to have a look at those if you'd like.
I personally just think that the ones I went over are the ones you're going to be finding the most uses
for.
Um, but yeah, and as I said, they're not gonna be something you're going to be using every single
day.
But when you do use them, they can really bring that extra edge to your game, such as power lines,
um, chains from the ceiling, all this kind of stuff that can get the player to interact with and make
the player actually feel like they're in a real life, in real life, rather than in just in a game
where you can walk through all this stuff and our lines are just straight across, just straight, just
straight lines and things like that.
Okay?
So really make sure you utilize these constraints as they can really bring your game from a semi-realistic
game to an ultra realistic game.
Um, so try out or try out or those play around with the settings, I think with constraints.
Um, some topics, um, I think are very easy to explain just by talking, um, on your computer.
Whereas I think constraints, because they're very visual sometimes some things such as constraints,
I think the best way to learn them is to understand the basics and then just give them a try out.
So please give these constraints a try out.
And for the next few lessons, we're just going to be looking at some odd sections that I haven't necessarily
covered before.
And the first one of those is to do with dialogue.
So join me in the next lesson.
We're going to be having a look at VAT.